package sample.service.impl;

import java.util.concurrent.TimeUnit;

import sample.mapper.PersonMapper;
import sample.model.Person;
import sample.service.MsService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created on 2020/6/29
 */
@Service("msService")
public class MsServiceImpl implements MsService {

//	@Autowired
//	private PersonRepository personRepository;
	@Autowired
	private PersonMapper personMapper;

	@Override
	public String getSomethingA() {
		//personMapper.findAll();
		try {
			TimeUnit.MILLISECONDS.sleep(20);
		}
		catch (InterruptedException e) {
		}
		return "something";
	}

	@Override
	public void doSomethingA() {
		Person person = new Person();
		person.setPersonId(1);
		personMapper.insert2(person);
		personMapper.insert(1);
		try {
			TimeUnit.MILLISECONDS.sleep(80);
		}
		catch (InterruptedException e) {
		}
	}
}
